package com.dapeng.cleardatabackend.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 节点表
 *
 * @author dapeng
 * @TableName node
 */
@TableName(value = "node")
@Data
public class Node implements Serializable {
    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 用户定义节点id
     */
    @TableField(value = "nodeId")
    private String nodeId;

    /**
     * 节点标签
     */
    @TableField(value = "label")
    private String label;

    /**
     * 节点文本
     */
    @TableField(value = "text")
    private String text;

    /**
     * 图谱id
     */
    @TableField(value = "graphId")
    private Long graphId;

    /**
     * 创建时间
     */
    @TableField(value = "createTime")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "updateTime")
    private Date updateTime;

    /**
     * 是否删除
     */
    @TableField(value = "isDelete")
    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Node node = (Node) o;
        return Objects.equals(node.nodeId, nodeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(nodeId);
    }

}